package com.suray.basic.wcs.path.properties;


import com.suray.basic.wcs.path.enums.DirectionStatus;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * WCS项目配置
 *
 * @author dean
 * @Date 2019/9/16 17:31
 */
@Component
public class PathProperties {

	/**
	 * 分段行驶中每段最大节点数 如过完全按照转弯和提升机口划分则填‘0’
	 */
	public static int KEEP_COUNT;

	/**
	 * CAR_DIRECTION对应的是坡道还是巷道
	 * 一般1，3方向对应巷道，2，4方向对应坡道
	 */
	public static DirectionStatus RAMP_OR_WAY;

	public static int LOCK_UP_COUNT;
	public static int LOCK_DOWN_COUNT;
	public static int LOCK_LEFT_COUNT;
	public static int LOCK_RIGHT_COUNT;
	public static boolean REMOVE_ROAD;

	private int keepCount;

	private int directionStatus;
	private int lockUpCount;
	private int lockDownCount;
	private int lockLeftCount;
	private int lockRightCount;
	private boolean removeRoad;

	@Value("${suray.basic.path.pathProperties.lockUpCount}")
	public void setLockUpCount(int lockUpCount) {
		this.lockUpCount = lockUpCount;
		LOCK_UP_COUNT = lockUpCount;
	}

	@Value("${suray.basic.path.pathProperties.lockDownCount}")
	public void setLockDownCount(int lockDownCount) {
		this.lockDownCount = lockDownCount;
		LOCK_DOWN_COUNT = lockDownCount;
	}

	@Value("${suray.basic.path.pathProperties.lockLeftCount}")
	public void setLockLeftCount(int lockLeftCount) {
		this.lockLeftCount = lockLeftCount;
		LOCK_LEFT_COUNT = lockLeftCount;
	}

	@Value("${suray.basic.path.pathProperties.lockRightCount}")
	public void setLockRightCount(int lockRightCount) {
		this.lockRightCount = lockRightCount;
		LOCK_RIGHT_COUNT = lockRightCount;
	}

	@Value("${suray.basic.path.pathProperties.removeRoad}")
	public void setRemoveRoad(boolean removeRoad) {
		this.removeRoad = removeRoad;
		REMOVE_ROAD = removeRoad;
	}

	public int getKeepCount() {
		return keepCount;
	}

	@Value("${suray.basic.path.pathProperties.keepCount}")
	public void setKeepCount(int keepCount) {
		this.keepCount = keepCount;
		PathProperties.KEEP_COUNT = keepCount;
	}

	public int getDirectionStatus() {
		return directionStatus;
	}

	@Value("${suray.basic.path.pathProperties.directionStatus}")
	public void setDirectionStatus(int directionStatus) {
		this.directionStatus = directionStatus;
		PathProperties.RAMP_OR_WAY = DirectionStatus.parseStatus(directionStatus);
	}

	public DirectionStatus getDirectionStatusEnum() {
		return DirectionStatus.parseStatus(directionStatus);
	}
}
